using MediatR;
using Medical.Api.Write.Application.Command.Wms.WmsLssueCommand;
using Medical.ErrorCode;
using Medical.Api.Write.Service.WmsService;
using System.Threading;
using System.Threading.Tasks;

namespace Medical.Api.Write.Application.Handler.Wms.WmsLssueHandler
{
    /// <summary>
    /// 发放主表签收处理器
    /// </summary>
    public class SignLssueHandler : IRequestHandler<SignLssueCommand, ApiResult<bool>>
    {
        private readonly IWmsService _service;
        public SignLssueHandler(IWmsService service) { _service = service; }
        public async Task<ApiResult<bool>> Handle(SignLssueCommand request, CancellationToken cancellationToken)
        {
            return await _service.SignLssueAsync(request.Id);
        }
    }
}